home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / ui / Section.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  917 b   |  47 lines

  1. package ui
  2. {
  3.    import flash.display.MovieClip;
  4.    
  5.    public class Section extends MovieClip
  6.    {
  7.        
  8.       
  9.       protected var _vis:Boolean = false;
  10.       
  11.       public function Section()
  12.       {
  13.          _vis = false;
  14.          super();
  15.          this.alpha = 0;
  16.          this.visible = false;
  17.       }
  18.       
  19.       protected function onSectionEnterFrame() : *
  20.       {
  21.          if(_vis)
  22.          {
  23.             this.alpha += (1 - this.alpha) * 0.25;
  24.             this.visible = true;
  25.          }
  26.          else
  27.          {
  28.             this.alpha += (0 - this.alpha) * 0.25;
  29.             if(this.alpha < 0.002)
  30.             {
  31.                this.visible = false;
  32.             }
  33.          }
  34.       }
  35.       
  36.       public function hideSection() : *
  37.       {
  38.          _vis = false;
  39.       }
  40.       
  41.       public function showSection() : *
  42.       {
  43.          _vis = true;
  44.       }
  45.    }
  46. }
  47.